/* ====================================================================
 * (#)Header: BasicEntityListener.java
 * (#)Revision: 
 * (#)Date Created: 2009-08-26
 * (#)Created By: Karol Wozniak
 * ====================================================================
 *
 * Copyright (c) 2007 karolak .  All rights reserved.
 *
 * ====================================================================
 * 
 * The software application represented here is the sole property of 
 * karolak. Its unauthorized utilization is expressly prohibited.
 * 
 * ====================================================================
 */
package com.karolak.entity.listener;

import java.util.Calendar;

import javax.persistence.PrePersist;
import javax.persistence.PreUpdate;

import com.karolak.entity.AbstractEntity;

/**
 * <code>BasicEntityListener</code> is ....
 * 
 * @author <a href="mailto:kwozniak@hotmail.com">Karol Wozniak</a>
 */
public class BasicEntityListener {
	@PrePersist
	public void setCreateDate(AbstractEntity<?> entity) {
		entity.setCreateDate(Calendar.getInstance().getTime());
	}

	@PreUpdate
	public void setUpdateDate(AbstractEntity<?> entity) {
		entity.setUpdateDate(Calendar.getInstance().getTime());
	}
}
